
<!DOCTYPE HTML>
<html lang="" >
    <head>
        <meta charset="UTF-8">
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
        <title>坐标转换 · GitBook</title>
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <meta name="description" content="">
        <meta name="generator" content="GitBook 3.2.2">
        
        
        
    
    <link rel="stylesheet" href="gitbook/style.css">

    
            
                
                <link rel="stylesheet" href="gitbook/gitbook-plugin-prism/prism.css">
                
            
                
                <link rel="stylesheet" href="gitbook/gitbook-plugin-search/search.css">
                
            
                
                <link rel="stylesheet" href="gitbook/gitbook-plugin-theme-vuejs/vue.css">
                
            
        

    

    
        
    
        
    
        
    
        
    
        
    
        
    

        
    
    
    <meta name="HandheldFriendly" content="true"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <link rel="apple-touch-icon-precomposed" sizes="152x152" href="gitbook/images/apple-touch-icon-precomposed-152.png">
    <link rel="shortcut icon" href="gitbook/images/favicon.ico" type="image/x-icon">

    
    

    </head>
    <body>
        
<div class="book">
    <div class="book-summary">
        
            
<div id="book-search-input" role="search">
    <input type="text" placeholder="Type to search" />
</div>

            
                <nav role="navigation">
                


<ul class="summary">
    
    

    

    
        
        
    
        <li class="chapter " data-level="1.1" data-path="./">
            
                <a href="./">
            
                    
                    文档信息
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2" data-path="build.html">
            
                <a href="build.html">
            
                    
                    项目构建
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3" data-path="link.html">
            
                <a href="link.html">
            
                    
                    安装
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4" >
            
                <span>
            
                    
                    基础使用
            
                </span>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.4.1" data-path="initMap.html">
            
                <a href="initMap.html">
            
                    
                    初始化地图
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.2" data-path="loadJXMap.html">
            
                <a href="loadJXMap.html">
            
                    
                    加载江西地图
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.3" data-path="LayerSwitcher.html">
            
                <a href="LayerSwitcher.html">
            
                    
                    底图切换
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.4" data-path="addPoints.html">
            
                <a href="addPoints.html">
            
                    
                    添加点
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.5" data-path="addLine.html">
            
                <a href="addLine.html">
            
                    
                    添加线
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.6" data-path="addPolygon.html">
            
                <a href="addPolygon.html">
            
                    
                    添加面
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.7" data-path="CustomCIrcle.html">
            
                <a href="CustomCIrcle.html">
            
                    
                    周边搜索圆
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.5" >
            
                <span>
            
                    
                    进阶
            
                </span>
            

            
            <ul class="articles">
                
    
        <li class="chapter active" data-level="1.5.1" data-path="CoordsTransform.html">
            
                <a href="CoordsTransform.html">
            
                    
                    坐标转换
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.6" >
            
                <span>
            
                    
                    类说明
            
                </span>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.6.1" data-path="class.html">
            
                <a href="class.html">
            
                    
                    map
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    

    

    <li class="divider"></li>

    <li>
        <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
            Published with GitBook
        </a>
    </li>
</ul>


                </nav>
            
        
    </div>

    <div class="book-body">
        
            <div class="body-inner">
                
                    

<div class="book-header" role="navigation">
    

    <!-- Title -->
    <h1>
        <i class="fa fa-circle-o-notch fa-spin"></i>
        <a href="." >坐标转换</a>
    </h1>
</div>




                    <div class="page-wrapper" tabindex="-1" role="main">
                        <div class="page-inner">
                            
<div id="book-search-results">
    <div class="search-noresults">
    
                                <section class="normal markdown-section">
                                
                                <h1 id="coordstransform-&#x5750;&#x6807;&#x8F6C;&#x6362;">CoordsTransform &#x5750;&#x6807;&#x8F6C;&#x6362;</h1>
<hr>
<p>&#x4E00;&#x4E2A;&#x63D0;&#x4F9B;&#x4E86;&#x767E;&#x5EA6;&#x5750;&#x6807;&#xFF08;BD09&#xFF09;&#x3001;&#x56FD;&#x6D4B;&#x5C40;&#x5750;&#x6807;&#xFF08;&#x706B;&#x661F;&#x5750;&#x6807;&#xFF0C;GCJ02&#xFF09;&#x3001;&#x548C;WGS84&#x5750;&#x6807;&#x7CFB;&#x4E4B;&#x95F4;&#x7684;&#x8F6C;&#x6362;&#x7684;&#x5DE5;&#x5177;&#x6A21;&#x5757;&#x3002;</p>
<h2 id="&#x5F53;&#x524D;&#x4E92;&#x8054;&#x7F51;&#x5730;&#x56FE;&#x7684;&#x5750;&#x6807;&#x7CFB;&#x73B0;&#x72B6;">&#x5F53;&#x524D;&#x4E92;&#x8054;&#x7F51;&#x5730;&#x56FE;&#x7684;&#x5750;&#x6807;&#x7CFB;&#x73B0;&#x72B6;</h2>
<h3 id="&#x5730;&#x7403;&#x5750;&#x6807;-wgs84">&#x5730;&#x7403;&#x5750;&#x6807; (WGS84)</h3>
<ul>
<li>&#x56FD;&#x9645;&#x6807;&#x51C6;&#xFF0C;&#x4ECE; GPS &#x8BBE;&#x5907;&#x4E2D;&#x53D6;&#x51FA;&#x7684;&#x6570;&#x636E;&#x7684;&#x5750;&#x6807;&#x7CFB;</li>
<li>&#x56FD;&#x9645;&#x5730;&#x56FE;&#x63D0;&#x4F9B;&#x5546;&#x4F7F;&#x7528;&#x7684;&#x5750;&#x6807;&#x7CFB;</li>
</ul>
<h3 id="&#x706B;&#x661F;&#x5750;&#x6807;-gcj-02&#x4E5F;&#x53EB;&#x56FD;&#x6D4B;&#x5C40;&#x5750;&#x6807;&#x7CFB;">&#x706B;&#x661F;&#x5750;&#x6807; (GCJ-02)&#x4E5F;&#x53EB;&#x56FD;&#x6D4B;&#x5C40;&#x5750;&#x6807;&#x7CFB;</h3>
<ul>
<li>&#x4E2D;&#x56FD;&#x6807;&#x51C6;&#xFF0C;&#x4ECE;&#x56FD;&#x884C;&#x79FB;&#x52A8;&#x8BBE;&#x5907;&#x4E2D;&#x5B9A;&#x4F4D;&#x83B7;&#x53D6;&#x7684;&#x5750;&#x6807;&#x6570;&#x636E;&#x4F7F;&#x7528;&#x8FD9;&#x4E2A;&#x5750;&#x6807;&#x7CFB;</li>
<li>&#x56FD;&#x5BB6;&#x89C4;&#x5B9A;&#xFF1A; &#x56FD;&#x5185;&#x51FA;&#x7248;&#x7684;&#x5404;&#x79CD;&#x5730;&#x56FE;&#x7CFB;&#x7EDF;&#xFF08;&#x5305;&#x62EC;&#x7535;&#x5B50;&#x5F62;&#x5F0F;&#xFF09;&#xFF0C;&#x5FC5;&#x987B;&#x81F3;&#x5C11;&#x91C7;&#x7528;GCJ-02&#x5BF9;&#x5730;&#x7406;&#x4F4D;&#x7F6E;&#x8FDB;&#x884C;&#x9996;&#x6B21;&#x52A0;&#x5BC6;&#x3002;</li>
</ul>
<h3 id="&#x767E;&#x5EA6;&#x5750;&#x6807;-bd-09">&#x767E;&#x5EA6;&#x5750;&#x6807; (BD-09)</h3>
<ul>
<li>&#x767E;&#x5EA6;&#x6807;&#x51C6;&#xFF0C;&#x767E;&#x5EA6; SDK&#xFF0C;&#x767E;&#x5EA6;&#x5730;&#x56FE;&#xFF0C;Geocoding &#x4F7F;&#x7528;</li>
</ul>
<h2 id="&#x5F00;&#x53D1;&#x8FC7;&#x7A0B;&#x9700;&#x8981;&#x6CE8;&#x610F;&#x7684;&#x4E8B;">&#x5F00;&#x53D1;&#x8FC7;&#x7A0B;&#x9700;&#x8981;&#x6CE8;&#x610F;&#x7684;&#x4E8B;</h2>
<ul>
<li><p>&#x4ECE;&#x8BBE;&#x5907;&#x83B7;&#x53D6;&#x7ECF;&#x7EAC;&#x5EA6;&#xFF08;GPS&#xFF09;&#x5750;&#x6807;</p>
<pre class="language-"><code>      &#x5982;&#x679C;&#x4F7F;&#x7528;&#x7684;&#x662F;&#x767E;&#x5EA6;sdk&#x90A3;&#x4E48;&#x53EF;&#x4EE5;&#x83B7;&#x5F97;&#x767E;&#x5EA6;&#x5750;&#x6807;&#xFF08;bd09&#xFF09;&#x6216;&#x8005;&#x706B;&#x661F;&#x5750;&#x6807;&#xFF08;GCJ02),&#x9ED8;&#x8BA4;&#x662F;bd09
      &#x5982;&#x679C;&#x4F7F;&#x7528;&#x7684;&#x662F;ios&#x7684;&#x539F;&#x751F;&#x5B9A;&#x4F4D;&#x5E93;&#xFF0C;&#x90A3;&#x4E48;&#x83B7;&#x5F97;&#x7684;&#x5750;&#x6807;&#x662F;WGS84
      &#x5982;&#x679C;&#x4F7F;&#x7528;&#x7684;&#x662F;&#x9AD8;&#x5FB7;sdk,&#x90A3;&#x4E48;&#x83B7;&#x53D6;&#x7684;&#x5750;&#x6807;&#x662F;GCJ02
</code></pre></li>
<li><p>&#x4E92;&#x8054;&#x7F51;&#x5728;&#x7EBF;&#x5730;&#x56FE;&#x4F7F;&#x7528;&#x7684;&#x5750;&#x6807;&#x7CFB;</p>
<pre class="language-"><code>  &#x706B;&#x661F;&#x5750;&#x6807;&#x7CFB;&#xFF1A;
          iOS &#x5730;&#x56FE;&#xFF08;&#x5176;&#x5B9E;&#x662F;&#x9AD8;&#x5FB7;&#xFF09;
          Google&#x56FD;&#x5185;&#x5730;&#x56FE;&#xFF08;.cn&#x57DF;&#x540D;&#x4E0B;&#xFF09;
          &#x641C;&#x641C;&#x3001;&#x963F;&#x91CC;&#x4E91;&#x3001;&#x9AD8;&#x5FB7;&#x5730;&#x56FE;&#x3001;&#x817E;&#x8BAF;
  &#x767E;&#x5EA6;&#x5750;&#x6807;&#x7CFB;&#xFF1A;
          &#x5F53;&#x7136;&#x53EA;&#x6709;&#x767E;&#x5EA6;&#x5730;&#x56FE;
  WGS84&#x5750;&#x6807;&#x7CFB;&#xFF1A;
          &#x56FD;&#x9645;&#x6807;&#x51C6;&#xFF0C;&#x8C37;&#x6B4C;&#x56FD;&#x5916;&#x5730;&#x56FE;&#x3001;osm&#x5730;&#x56FE;&#x7B49;&#x56FD;&#x5916;&#x7684;&#x5730;&#x56FE;&#x4E00;&#x822C;&#x90FD;&#x662F;&#x8FD9;&#x4E2A;
</code></pre></li>
</ul>
<hr>
<h3 id="&#x793A;&#x4F8B;&#x7528;&#x6CD5;&#xFF08;exampleusage&#xFF09;">&#x793A;&#x4F8B;&#x7528;&#x6CD5;&#xFF08;Example&amp;Usage&#xFF09;</h3>
<pre class="language-"><code class="lang-javascript"><span class="token keyword">import</span> CoordsTransform <span class="token keyword">from</span> <span class="token string">&apos;./CoordsTransform&apos;</span>

<span class="token keyword">let</span> coordsT <span class="token operator">=</span> <span class="token keyword">new</span> <span class="token class-name">CoordsTransform</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
<span class="token function">console</span><span class="token punctuation">(</span>coordsT<span class="token punctuation">.</span><span class="token function">wgs84togcj02</span><span class="token punctuation">(</span><span class="token number">116.404</span><span class="token punctuation">,</span> <span class="token number">39.915</span><span class="token punctuation">)</span><span class="token punctuation">)</span> <span class="token comment" spellcheck="true">// [ 116.41024449916938, 39.91640428150164 ]</span>
<span class="token function">console</span><span class="token punctuation">(</span>coordsT<span class="token punctuation">.</span><span class="token function">gcj02towgs84</span><span class="token punctuation">(</span><span class="token number">116.404</span><span class="token punctuation">,</span> <span class="token number">39.915</span><span class="token punctuation">)</span><span class="token punctuation">)</span> <span class="token comment" spellcheck="true">// [ 116.39775550083061, 39.91359571849836 ]</span>
<span class="token function">console</span><span class="token punctuation">(</span>coordsT<span class="token punctuation">.</span><span class="token function">gcj02tobd</span><span class="token punctuation">(</span><span class="token number">116.404</span><span class="token punctuation">,</span> <span class="token number">39.915</span><span class="token punctuation">)</span><span class="token punctuation">)</span> <span class="token comment" spellcheck="true">// [ 116.41036949371029, 39.92133699351021 ]</span>
<span class="token function">console</span><span class="token punctuation">(</span>coordsT<span class="token punctuation">.</span><span class="token function">bdtogcj02</span><span class="token punctuation">(</span><span class="token number">116.404</span><span class="token punctuation">,</span> <span class="token number">39.915</span><span class="token punctuation">)</span><span class="token punctuation">)</span> <span class="token comment" spellcheck="true">// [ 116.39762729119315, 39.90865673957631 ]</span>
</code></pre>

                                
                                </section>
                            
    </div>
    <div class="search-results">
        <div class="has-results">
            
            <h1 class="search-results-title"><span class='search-results-count'></span> results matching "<span class='search-query'></span>"</h1>
            <ul class="search-results-list"></ul>
            
        </div>
        <div class="no-results">
            
            <h1 class="search-results-title">No results matching "<span class='search-query'></span>"</h1>
            
        </div>
    </div>
</div>

                        </div>
                    </div>
                
            </div>

            
                
                
            
        
    </div>

    <script>
        var gitbook = gitbook || [];
        gitbook.push(function() {
            gitbook.page.hasChanged({"page":{"title":"坐标转换","level":"1.5.1","depth":2,"next":{"title":"类说明","level":"1.6","depth":1,"ref":"","articles":[{"title":"map","level":"1.6.1","depth":2,"path":"class.md","ref":"class.md","articles":[]}]},"previous":{"title":"进阶","level":"1.5","depth":1,"ref":"","articles":[{"title":"坐标转换","level":"1.5.1","depth":2,"path":"CoordsTransform.md","ref":"CoordsTransform.md","articles":[]}]},"dir":"ltr"},"config":{"plugins":["edit-link","prism","theme-vuejs@git+https://github.com/pearofducks/gitbook-plugin-theme-vuejs.git","-fontsettings","-highlight","github","livereload"],"root":"./api","styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"pluginsConfig":{"prism":{},"github":{"url":"https://github.com/smileFDD/HMap.git"},"livereload":{},"search":{},"theme-vuejs":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"sharing":{"facebook":false,"twitter":false,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"edit-link":{"label":"编辑此页","base":"https://github.com/smileFDD/HMap/tree/master/docs/api"},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"theme":"default","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"links":{"sharing":{"facebook":false,"twitter":false}},"gitbook":">3.0.0"},"file":{"path":"CoordsTransform.md","mtime":"2017-03-18T03:22:18.321Z","type":"markdown"},"gitbook":{"version":"3.2.2","time":"2017-03-18T05:20:47.112Z"},"basePath":".","book":{"language":""}});
        });
    </script>
</div>

        
    <script src="gitbook/gitbook.js"></script>
    <script src="gitbook/theme.js"></script>
    
        
        <script src="gitbook/gitbook-plugin-edit-link/plugin.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-github/plugin.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-livereload/plugin.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-search/search-engine.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-search/search.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-lunr/lunr.min.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-lunr/search-lunr.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-sharing/buttons.js"></script>
        
    

    </body>
</html>

